<?php if(!defined('PHPOK_SET')){die('<h3>Error...</h3>');}?><?php QG_C_TEMPLATE::p("global_head","","0");?>
<?php QG_C_TEMPLATE::p("right.css","","0");?>
<?php QG_C_TEMPLATE::p("right.head","","0");?>

<!-- 订单管理 -->
<table width="100%">
<tr>
	<td class="qg_notice" style="text-align:left;">
		<a href="admin.php?file=index">系统首页</a>
		&raquo;
		<a href="admin.php?file=order&act=list">订单列表</a>
	</td>
</tr>
</table>

<div class="table" style="border-bottom:1px #D4D4D4 solid;">
<table border="0">
<form method="post" action="admin.php?file=order&act=list">
<tr>
	<td>关键字：</td>
	<td><input type="text" name="keywords" id="keywords" value="<?php echo $keywords;?>"></td>
	<td>
		<select name="stype" id="stype">
			<option value="subject">主题</option>
			<option value="sn">订单编号</option>
			<option value="user"<?php if($stype == "user"){?> selected<?php } ?>>联系人</option>
			<option value="email"<?php if($stype == "email"){?> selected<?php } ?>>邮箱</option>
			<option value="address"<?php if($stype == "address"){?> selected<?php } ?>>联系人地址</option>
			<option value="contact"<?php if($stype == "contact"){?> selected<?php } ?>>联系方式</option>
			<option value="zipcode"<?php if($stype == "zipcode"){?> selected<?php } ?>>邮编</option>
		</select>
	</td>
	<td>
		<select name="status" id="status">
			<option value="0"<?php if($status == "0" || !$ifcheck){?> selected<?php } ?>>全部</option>
			<option value="1"<?php if($status == 1){?> selected<?php } ?>>已锁定</option>
			<option value="2"<?php if($status == 2){?> selected<?php } ?>>未锁定</option>
		</select>
	</td>
	<td>
		<input type="submit" value="搜索">
	</td>
</tr>
</form>
</table>
</div>
<?php $_i=0;$msglist=(is_array($msglist))?$msglist:array();foreach($msglist AS  $key=>$value){$_i++; ?>
<div id="order_<?php echo $value[id];?>" class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
	<table width="100%" style="layout:fixed;" cellpadding="0" cellspacing="0">
	<tr>
		<td class="msg_subject">
			<span class="msg_attr">[<?php echo $value[sn];?>][ID:<?php echo $value[id];?>]</span>
			<a href="#" onclick="qgMsg(<?php echo $value[id];?>)"><?php echo $value[subject];?></a>
		</td>
		<td class="msg_category">
			<a href="#" onclick="qgUser(<?php echo $value[id];?>)"><?php echo $value[user];?></a>
		</td>
		<td class="msg_hits"><?php echo $value[msgcount];?></td>
		<td class="msg_postdate"><?php echo $value[postdate];?></td>
		<td style="width:200px;height:25px;">
			<input type="button" value="查看" class="mybutton_01" onclick="qgMsg(<?php echo $value[id];?>)">
			<?php if($value[status]){?>
			<input type="button" value="已锁定" class="mybutton_01" id="mybutton_<?php echo $value[id];?>" onclick="qgLock(<?php echo $value[id];?>)">
			<?php }else{ ?>
			<input type="button" value="未锁定" class="mybutton_01" id="mybutton_<?php echo $value[id];?>" style="color:red;" onclick="qgLock(<?php echo $value[id];?>)">
			<?php } ?>
			<input type="button" value="删除" class="mybutton_01" onclick="qg_delete(<?php echo $value[id];?>)">
		</td>
	</tr>
	</table>
</div>
<?php } ?>

<div align="right"><?php echo $pagelist;?></div>

<script type="text/javascript">
function qgLock(id)
{
	if(!id)
	{
		alert("操作非法！");
		return false;
	}
	qgurl("admin.php?file=order&act=status&id="+id);
}
function qgUser(id)
{
	if(!id)
	{
		alert("操作非法！");
		return false;
	}
	var url = "admin.php?file=open.order&id=" + id;
	qg_open(url,400);
}
function qgMsg(id)
{
	if(!id)
	{
		alert("操作非法！");
		return false;
	}
	var url = "admin.php?file=open.order&id=" + id;
	qg_open(url,400);
}
function qg_delete(id)
{
	//判断是否删除
	question = confirm("确认删除该信息吗？特别说明，删除后无法恢复！");
	if (question != "0")
	{
		qgurl("admin.php?file=order&act=delete&id="+id);
	}
}
</script>

<?php QG_C_TEMPLATE::p("foot","","0");?>